<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 
    
    
    $(".pdf").click(function () {
		url= location.href+'/pdf/si'
        location.replace(url)
	}).css('cursor','pointer')
    
    $(".xls").click(function () {
		url= location.href+'/excel/si'
        location.replace(url)
	}).css('cursor','pointer')  
   
<?php $this->placeholder('onReady')->captureEnd() ?>





<?=$this->msg($this->translate('Facturación detallada').' '.$this->proyecto,'head',null,false);?>

<?if($this->rows):?>


<table id="<?= $this->id_tablesorter?>" width="100%" class="tablesorter"> 
    <caption>
       <div id="total_table_filter" style="float: right;">Total <span class="filtradas"><?=count($this->rows)?> Registros</span></div>    
       <div style="margin: 10px;;">
            <span class="pdf"><img src="/img/pdf.png"/></span>
            <span class="xls"><img src="/img/xls.png"/></span>
       </div>
   
   
    </caption>
<thead>
<tr>
    <th><?php echo $this->translate('Fecha');?></th>
    <th><?php echo $this->translate('Contador');?></th>
    <th><?php echo $this->translate('Nombre');?></th>
    <th><?php echo $this->translate('kWh Consumidos');?></th>
    <th><?php echo $this->translate('K');?></th>
    <th><?php echo $this->translate('KWh facturables');?></th>
    <th><?php echo $this->translate('Precio €/kWh');?></th>
    <th><?php echo $this->translate('Importe €');?></th>
    <th><?php echo $this->translate('% Gestión');?></th>
    <th><?php echo $this->translate('Importe Gestión');?></th>
    <th><?php echo $this->translate('Facturación €');?></th>
    <th><?php echo $this->translate('Modalidad Facturación');?></th>
    
</tr>
</thead>
<tbody>
<?foreach($this->rows as $k => $v):?>
<tr>
    <td><?=$v['fecha']?></td>
    <td><a href="/index.php?modulo=Explotacion_Lectura_Contador&idZona=<?=$this->idZona?>&informe=true&id_contador=<?=$v['id_contador']?>"><?=$v['con_numero']?></a></td>
    <td><?=$v['con_name']?></td>
    <td><?=$this->NumEs($v['consumo_equipos_propios'],0)?><?=$this->linkchart("index/lecturas-contador/id/{$v['id_contador']}")?></td>
    <td><?=$this->NumEs($v['coeficiente_facturacion'],2)?></td>
    <td><?=$this->NumEs($v['consumo_facturable'])?></td>
    <td><?=$this->NumEs($v['precio_aplicado'],4)?></td>
    <td><?=$this->NumEs($v['importe'],2);?></td>
    <td><?=$this->NumEs($v['porcentaje_gestion'],2);?></td>
    <td><?=$this->NumEs($v['import_gestion'],2);?></td>
    <td><?=$this->NumEs($v['fact_consumo'],2);?></td>
    <td><?=$this->escape($v['texto_facturacion'])?></td>
  </tr>
<?endforeach?>
</tbody>
<tfoot>
<tr>
    <th></th>
    <th></th>
    <th></th>
    <th><?php echo $this->numES($this->suma['consumo_equipos_propios'],2);?> kWh</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['consumo_facturable'],2);?> kWh</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['importe'],2);?> €</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['import_gestion'],2);?> €</th>
    <th><?php echo $this->numES($this->suma['fact_consumo'],2);?> €</th>
    <th></th>
</tr>
</tfoot>
</table>
<?endif?>



